<!DOCTYPE html>
<!--suppress ALL -->
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">

    <title>亿人财富_为您赚钱和提供高收益理财产品的理财投资投资理财平台</title>

    <!--[if lt IE 9]>
    <script th:src="@{/statics/newcommon/js/html5shiv.js}"></script>
    <![endif]-->
    <link  rel="Shortcut  Icon"  th:href="@{/statics/home/images/minilogo.png}">
    <link rel="stylesheet" th:href="@{'/statics/newcommon/css/m2-commonNew.css/?20160520'}">
    <link rel="stylesheet" th:href="@{'/statics/home2/css/m2-main.css?20160520'}">
    <link rel="stylesheet" th:href="@{'/statics/newcommon/css/m2-common.css?20160520'}">
    <script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{'/statics/newcommon/js/common.js?20160520'}"></script>

    <link rel="stylesheet" th:href="@{/statics/home2/css/m2-login.css}">
    <script type="text/javascript" th:src="@{/js/common.js}"></script>
    <style type="text/css">
        .myloginmask {position:fixed;top: 0;left: 0;right: 0;bottom: 0;background-color: black;display: none;opacity: 0.7;z-index: 800;filter:alpha(opacity=70)}
        .mylogin {position:   fixed;top: 50%;left: 50%;margin-top: -346px;margin-left: -260px;width: 520px;height: 496px;background-image: url("statics/home2/images/login/login_info.png");background-repeat: no-repeat;z-index: 1000;display: none;}
        .mylogin .topcontent {font-weight:bold;text-align: center;color: #666666;font-size: 18px;padding-top: 284px;line-height: 36px;}
        .mylogin .topcontent span {color: #883535;}
        .mylogin .bottomcontent {font-weight:bold;font-size:20px;line-height: 30px;width:384px;margin: 50px auto;}
        .mylogin .bottomcontent a{color: #333333;text-decoration: none;}
        .mylogin .closeimg {position: absolute;top: 220px;right: 14px;width: 43px;height: 43px;background-image: url("statics/home2/images/login/cha.png");}
    </style>

    <script type="text/javascript">
        $(function(){
            $('.m2-pwdConfirm-auto b').click(function(){
                $('.m2-pwdConfirm-auto,.m2-pwdBg').hide();
            })
        })
    </script>
    <script type="text/javascript">
        function infoDialogClose(){
            $('.m2-pwdConfirm-close').click(function(){
                $('.m2-pwdBg').hide();
                $('.m2-pwdConfirm').hide();
                $('.m2-pwdConfirm-con').text('');
                $('#dialog-status').removeClass('m2-pwdConfirm-ture');
                $('#dialog-status').removeClass('m2-pwdConfirm-false');
                $(this).unbind();
            });
        }
        function showInfoDialog(text,status,func,callback){
            $('.m2-pwdConfirm-con').text(text);
            if(status){
                $('#dialog-status').addClass('m2-pwdConfirm-ture');
            }else{
                $('#dialog-status').addClass('m2-pwdConfirm-false');
            }
            $('.m2-pwdBg').show();
            $('.m2-pwdConfirm').show();
            if(typeof(callback)=='function'){
                $('.m2-pwdConfirm-close').click(callback);
            }
            infoDialogClose();
            if(typeof(func)=='function'){
                func();
            }
//			$(".mylogin").show();
        }
        function showLoginInfoDialog(text,status,func,callback){
            $('.m2-pwdConfirm-con').text(text);
            if(status){
                $('#dialog-status').addClass('m2-pwdConfirm-ture');
            }else{
                $('#dialog-status').addClass('m2-pwdConfirm-false');
            }
            $('.m2-pwdBg').show();
            $('.m2-pwdConfirm').show();
            if(status){
                $('.m2-pwdConfirm').hide();
                $('.m2-pwdConfirm-auto').show();
            }
            if(typeof(callback)=='function'){
                $('.m2-pwdConfirm-close').click(callback);
            }
            infoDialogClose();
            if(typeof(func)=='function'){
                func();
            }
        }
        function showLoginDialog(text,status){
            $("#nowcoin").html(text.allcoin);
            $("#overcoin").html(text.overcoin);
            $("#user").html(text.userName);
            $(".mylogin").show();
            $(".myloginmask").show();
        }
        $(".mylogin .closeimg").click(function(){
            $(".mylogin").hide();
            $(".myloginmask").hide();
            window.location.href="/Index";
        })
    </script>
    <!--公共提示框end-->
    <!--头部end-->
    <div class="m2-mainbody">
        <div class="m2-pwd-con">
            <a href="index.html" class="m2-pwdLink-index"></a>
            <div class="m2-pwdBg1-con">
                <div class="m2-pwdBg1">
                    <h1>亿人财富P2B理财平台</h1>
                    <p class="m2-pwdBg1-list">安全&nbsp;|&nbsp;阳光&nbsp;|&nbsp;创新&nbsp;|&nbsp;共赢</p>
                    <p class="m2-pwdBg1-link">更多帮助内容请进<a href="guide.html">服务中心&raquo;</a></p>
                    <div class="m2-pwdMan"></div>
                </div>
                <div class="m2-pwdBg1icon"></div>
            </div>
            <div class="m2-pwdBg2-con">
                <div class="m2-pwdBg-bottom"><p>为了您的数据安全，我们采用了SSL传输方式，256位SGC加密保护!</p></div>
            </div>
            <div class="m2-pwdBox">
                <div class="m2-pwdLogo"><a href="#"></a></div>
                <h2>找回密码</h2>
                <div class="m2-pwdTab">
                    <div class="m2-pwdTab1"><a href="#m2-pwdTelform">手机找回</a></div>
                    <div class="m2-pwdTab2"><a href="#m2-pwdEmailform">邮箱找回</a></div>
                </div>
                <form class="m2-pwdForm" id="m2-pwdTelform" th:action="@{/users/retrievepass}" method="post">
                    <h3>
                        <span th:if="results!=null" th:text="${results}" style="color: red"></span>
                    </h3>
                    <div class="m2-pwdFrom-item" id="m2-pwdTab1-user">
                        <span><i></i>用户名</span>
                        <input placeholder="请输入用户名" type="text" required pattern="^[a-zA-Z0-9]{6,12}$" title="由3-12位字母数字组成" name="username" id='user_name'>
                        <u></u>
                    </div>
                    <div class="m2-pwdFrom-item" id="m2-pwdTab1-user" >
                        <span><i></i>新的密码</span>
                        <input placeholder="请输入密码" required pattern="^[a-zA-Z0-9]{6,12}$"  title="由6-12位字母数字组成" name="password" type="password" maxlength="11">
                        <u></u>
                    </div>
                    <div class="m2-pwdFrom-item" id="m2-pwdTab1-user">
                        <span><i></i>确认密码</span>
                        <input placeholder="请输入密码" required pattern="^[a-zA-Z0-9]{6,12}$"  title="由6-12位字母数字组成" name="ConfirmPass" type="password" maxlength="11" >
                        <u></u>
                    </div>
                    <div class="m2-pwdFrom-item" id="m2-pwdTab1-tel">
                        <span><i></i>手机号</span>
                        <input placeholder="请输入手机号" required pattern="(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$"  title="手机号的格式要正确" name="phone" type="text" maxlength="11" id='user_phone'>
                        <u></u>
                    </div>
                    <div class="m2-pwdFrom-item" >
                        <span><i></i>短信验证码</span>
                        <input placeholder="请输入验证码" name="phoneStatus" type="text">
                        <b><input type="button" value="免费获取验证码" onclick="settime(this)" />
                        </b>
                        <u></u>
                    </div>

                    <div class="m2-pwdSubmit">
                        <input  type="submit" value="找回密码" >
                    </div>
                   <!-- <input type="hidden" name="__hash__" value="3fcafd5e63643c8665f3937c94015ce5_fa0c645dc57de07370732795ec935b8d" />-->
                </form>

                <form class="m2-pwdForm" id="m2-pwdEmailform" th:action="@{/users/emailpass}" method="post">
                    <div class="m2-pwdFrom-item" id="m2-pwdTab2-user">
                        <span><i></i>用户名</span>
                        <input placeholder="请输入用户名" required pattern="^[a-zA-Z0-9]{6,12}$" title="由3-12位字母数字组成" type="text" name="username" id='user_name_e'>
                        <u></u>
                    </div>
                    <div class="m2-pwdFrom-item" id="m2-pwdTab1-user" >
                        <span><i></i>新的密码</span>
                        <input placeholder="请输入密码" required pattern="^[a-zA-Z0-9]{6,12}$"  title="由6-12位字母数字组成" name="password" type="password" maxlength="11" >
                        <u></u>
                    </div>
                    <div class="m2-pwdFrom-item" id="m2-pwdTab1-user" >
                        <span><i></i>确认密码</span>
                        <input placeholder="请输入密码" required pattern="^[a-zA-Z0-9]{6,12}$"  title="由6-12位字母数字组成" name="ConfirmPass" type="password" maxlength="11" >
                        <u></u>
                    </div>
                    <div class="m2-pwdFrom-item" id="m2-pwdTab2-email">
                        <span><i></i>邮箱</span>
                        <input placeholder="请输入邮箱" required pattern="^\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}$" title="请输入格式正确的邮箱" name="email" type="text" id='user_email'>
                        <u></u>
                    </div>

                    <div class="m2-pwdSubmit">
                        <input type="submit" value="找回密码">
                    </div>
                    <!--<input type="hidden" name="__hash__" value="3fcafd5e63643c8665f3937c94015ce5_fa0c645dc57de07370732795ec935b8d" />-->
                </form>

                <div class="m2-pwdForgetshow">
                    <p><i></i><span>4006&nbsp;777&nbsp;518</span></p>
                    <b></b>
                </div>
            </div>
        </div>
      </div>
</head>
        <script type="text/javascript" th:inline="javascript">
            var countdown=60;
            function settime(val) {
                if (countdown == 60) {
                        captcha();
                }
                if (countdown == 0) {
                    val.removeAttribute("disabled");
                    val.value="免费获取验证码";
                    countdown = 60;
                    countdown.stop();
                } else {
                    val.setAttribute("disabled", true);
                    val.value="重新发送(" + countdown + ")";
                    countdown--;
                }
                setTimeout(function() {
                    settime(val)
                },1000)
            }
            function captcha(){
                var phone=$("[name=phone]").val();
                alert(phone);
                if(phone!=""||phone!=null){
                    var loginUrl = /*[[@{/users/userPhone}]]*/
                        $.ajax({
                            url:loginUrl,
                            data:{"userPhone":phone},
                            dataType:"text",
                            type:"get",
                            success:function(status){
                                if (status=="0"){
                                    alert("手机号发送成功");
                                }else if (status=="1") {
                                    alert("验证码发送达到上限,手机号错误发送失败");
                                }
                                else if (status=="2") {
                                    alert("短信发送失败");
                                }
                                else if (status=="3") {
                                    alert("手机号不可为空!!!");
                                }
                            }

                        })
                }else {
                    alert("手机号不可为空!!!");
                }
            }





            //tab 切换
            $(function(){
                $('.m2-pwdTab1').click(function(){
                    $(this).css("background","url(statics/home2/images/m2-loginIcon.png) no-repeat 0 -25px");
                    $('.m2-pwdTab2').css("background","none");
                    $('#m2-pwdEmailform').hide();
                    $('#m2-pwdTelform').show();
                });
                $('.m2-pwdTab2').click(function(){
                    $(this).css("background","url(statics/home2/images/m2-loginIcon.png) no-repeat 0 -25px");
                    $('.m2-pwdTab1').css("background","none");
                    $('#m2-pwdTelform').hide();
                    $('#m2-pwdEmailform').show();
                });

                //主体窗口居中
                var padAdd =($(document).height()-768-131)/2; //背景框内边距增加值
                if ($(document).height()>899) {
                    $('.m2-pwdBg1-con').css('padding-top',padAdd+182);
                    $('.m2-pwdBg2-con').css('padding-top',padAdd);
                };
                //忘记了点击弹窗
                $('.m2-pwdForget').click(function(){
                    $('.m2-pwdForgetshow').show();
                });
                //关闭忘记弹窗
                $('.m2-pwdForgetshow b').click(function(){
                    $('.m2-pwdForgetshow').hide();
                });
            });
            //========================================
            var second=60;
            var timer=null;
            var verifynum = Number(4);
            var mbTest = /^(13|14|15|17|18)[0-9]{9}$/;
            var reMail = /^(?:[a-z\d]+[_\-\+\.]?)*[a-z\d]+@(?:([a-z\d]+\-?)*[a-z\d]+\.)+([a-z]{2,})+$/i;
            $(function(){
                $("#sendCode").bind("click",function(){
                    sendPhoneCode();
                });
                $("#user_name").focus(function(){
                    showMsg(this,"请输入您注册时使用的用户名");
                }).blur(function(){
                    if($(this).val()=="") showMsg(this,"用户名不能为空",'error');
                    else  showMsg(this,"",'success');
                });

                $("#user_phone").focus(function(){
                    showMsg(this,"请输入您认证时使用的手机号码");
                }).blur(function(){
                    if(!mbTest.test($(this).val())) showMsg(this,"请输入正确的手机号码",'error');
                    else  showMsg(this,"",'success');
                });

                //=========email
                $("#user_name_e").focus(function(){
                    showMsg(this,"请输入您注册时使用的用户名");
                }).blur(function(){
                    if($(this).val()=="") showMsg(this,"用户名不能为空",'error');
                    else  showMsg(this,"",'success');
                });

                $("#user_email").focus(function(){
                    showMsg(this,"请输入您注册时填写的邮箱地址");
                }).blur(function(){
                    if(!reMail.test($(this).val())) showMsg(this,"请输入正确的邮箱地址",'error');
                    else  showMsg(this,"",'success');
                });
                if(verifynum >= 3){
                    $('#m2-pwdTab1-code').show();
                }
            })

            function sendPhoneCode(){
                var p={};
                var phone = $("#user_phone").val();
                var user_name = $("#user_name").val();
                var pcode = $("#pcode").val();
                if(!mbTest.test(phone)){
                    $("#user_phone").parent().children('u').text("请输入正确的手机号码");
                    return false;
                }
                if(!user_name){
                    $("#user_name").parent().children('u').text("用户名不能为空","warn",2);
                    return false;
                }
                p.cellphone = phone;
                p.user_name = user_name;
                p.pcode = pcode;
                postData("Common-sendphone",p,function(d){
                    verifynum ++;
                    if(d.status==1){
                        showInfoDialog(d.message,1);
                        setLeftTime();
                    }
                    else{
                        showInfoDialog(d.message,0);
                    }
                });

            }

            function setLeftTime(){
                if(second<0){
                    clearTimeout(timer);
                    second=60;
                    if(verifynum >= 3){
                        $('#m2-pwdTab1-code').show();
                    }
                    $("#sendCode").html("重发验证码").bind("click",function(){
                        sendPhoneCode();
                    });
                }else{
                    $("#sendCode").unbind().html(second + "秒后重发");
                    timer = setTimeout(function(){
                        second--;
                        clearTimeout(timer);
                        setLeftTime();
                    },1000);
                }
            }

            function showMsg(dom,msg,type){
                $(dom).parent().children('u').text(msg);
            }

            function getpassword(){
                var phone = $("#user_phone").val();
                var user_name = $("#user_name").val();
                var code = $("#vcode").val();
                var pcode = $("#pcode").val();
                if(!mbTest.test(phone)){
                    $("#user_phone").parent().children('u').text("请输入正确的手机号码");
                    return false;
                }
                if(!user_name){
                    $("#user_name").parent().children('u').text("用户名不能为空");
                    return false;
                }
                var p={};
                p.cellphone = phone;
                p.user_name = user_name;
                p.vcode = code;
                postData("Common-verifyPhonenew",p,function(d){
                    showInfoDialog(d.message,d.status,function(){
                        if(d.referer){
                            setTimeout(function(){
                                window.location.href = d.referer;
                            },3000);
                        }
                    });
                });
            }

            function sendEmail(){
                var p={};
                var user_name = $("#user_name_e").val();
                var user_email = $("#user_email").val();
                if(!reMail.test(user_email)){
                    $("#user_email").parent().children('u').text("请输入正确的邮箱地址");
                    return false;
                }
                if(!user_name){
                    $("#user_name_e").parent().children('u').text("用户名不能为空");
                    return false;
                }

                p.user_email = user_email;
                p.user_name = user_name;
                postData("Common-sendemailnew",p,function(d){
                    if(d.status==1){
                        showInfoDialog(d.message,'success');
                        $("#vcodetr").slideDown();
                        $("#sendCode").remove();
                    }
                    else{
                        showInfoDialog(d.message,0);
                    }
                });
            }
        </script>
        </body>
</html>